<template>
	<view class="/">
		<view v-if="showImg" class="img-box"><img class="img" :src="icon" alt="" /></view>
		<view class="gary" v-if="title">~ {{ title }} ~</view>
	</view>
</template>

<script>
	let app = getApp();
	export default {
		props: {
			showImg: {
				type: Boolean,
				default: true
			},
			tip: {
				type: String,
				default: '暂无数据'
			},
			icon: {
				type: String,
				default: '/static/images/without.png'
			}
		},
		data() {
			return {
				title: '',
			};
		},
		watch: {
			tip: {
				handler(n, o) {
					console.log(n, o);
					this.title = n;
				},
				immediate: true,
				deep: true
			}
		},
	};
</script>

<style scoped>
	.img-box {
		width: 300rpx;
		height: 300rpx;
		margin: 50rpx auto;
	}

	.img {
		width: 100%;
		height: 100%;
		display: inline-block;
	}

	.gary {
		color: #888888;
		font-size: 28rpx;
		text-align: center;
	}
</style>
